package thread2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: bjc
 * Date: 2025-08-18
 * Time: 21:41
 */
public class ThreadDemo4 {
    public static void main(String[] args){
        //创建一个对象
        Object locker = new Object();
        //创建一个线程
        Thread t = new Thread(()->{
            synchronized (locker){
                synchronized (locker){
                    System.out.println("hello world");
                }
                //其他逻辑～～
            }
        });
        t.start();
    }
}
